<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加任务</title>
    <link href="__CSS__/bootstrap.min.css" rel="stylesheet">
    <link href="__CSS__/app.css" rel="stylesheet">
</head>
<body >
    <div class="app-header">
        <b><a class="return_a" href="javascript:history.go(-1)">< 在线任务发布系统</a></b>
    </div>
    <div class="container-fluid">
        <!--记账内容头部-->
        <div class="row myself-con-head text-center" >
            <div><img src="__UPLOADS__<empty name="Userinfo.userpho">me.jpg<else />{$Userinfo.userpho}</empty> " class="img-circle"></div>
            <div>{$Userinfo.nickname}</div>
        </div>

        <!--记账内容主体-->
        <div class=" accountcon-main">
            <div class="row">
                <form class="form-horizontal" style="margin: 20px 10%;" action="__SELF__" method="post">
                    <input type="hidden" name="id" value="{$info.id}">
                    <div class="form-group">
                        <label for="finish_time" class="control-label">完成时间：</label>
                        <input type="text" class="form-control" id="finish_time" name="finish_time" value="{$info.finish_time}" placeholder="完成时间">
                    </div>
                    <div class="form-group">
                        <label for="finish_time" class="control-label">选课班标签：</label>
                        <input type="text" class="form-control" id="classtag" name="classtag" value="{$info.classtag}" placeholder="选课班标签">
                    </div>
                    <div class="form-group">
                        <label for="remark" class="control-label">任务详情：</label>
                        <textarea class="form-control" id="remark" name="remark" style="height: 100px;">{$info.remark}</textarea>
                    </div>
                    <div class="form-group text-center">
                        <button type="submit" class="btn btn-primary" onclick="return checkAddTask(this.form)"><empty name="info.id">添加<else/>编辑</empty>任务</button>
                    </div>
                </form>
            </div>
        </div>

    </div>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/validate.js"></script>
<script src="__JS__/laydate/laydate.js"></script>
<script>
    //执行一个laydate实例
    laydate.render({
        elem: '#finish_time', //记账日期
        type: 'datetime'
    });

    /**
     *添加任务息验证
     */
    function checkAddTask(form) {
        if(form.finish_time.value==''){
            form.title.focus();
            alert("标题不能为空！");
            return false;
        }
        if(form.remark.value==''){
            form.remark.focus();
            alert("详情不能为空！");
            return false;
        }
        if(form.classtag.value==''){
            form.classtag.focus();
            alert("选课班标签不能为空！");
            return false;
        }
        return true;
    }

</script>
</body>
</html>